﻿/*
 * ====================================================================
 * Copyright (c) 2000-2006 MineHe.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://www.minehe.net/projects/miucos/terms.aspx.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 *
 * This software consists of voluntary contributions made by many
 * individuals.  For exact contribution history, see the revision
 * history and logs, available at http://www.minehe.net/projects/miucos/ or 
 * http://code.google.com/p/miucos/.
 * 
 * WARNNING!!!!!!
 * YOU CAN NOT USE THIS CODE FILE OR ANY CODES IN MIUCOS FILES FOR COMMERCIAL
 * SYSTEM OR PURPOSE.
 * ====================================================================
 */

using System;
using System.Collections.Generic;
using System.Text;

namespace minehe.miucos.common
{
	/// <summary>
	/// 属性化接口，提供字符串形式的属性访问功能
	/// </summary>
	public interface IPropertier
	{
		/// <summary>
		/// 获取属性名称遍历实例
		/// </summary>
		/// <returns>结果，如果不能支持属性遍历则返回<see cref="ResultCodes.RC_NOTSUPPORT"/>结果代码</returns>
		Result<IEnumerable<string>> GetPropertiesEnumerator();
		/// <summary>
		/// 查询是否存在指定名称的属性
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		bool HasProperty(string a_name);
		/// <summary>
		/// 测试指定名称的属性值是否为空
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<bool> IsPropertyNull(string a_name);
		/// <summary>
		/// 获取指定属性名称对应的属性值
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果，如果属性不存在则返回<see cref="ResultCodes.RC_NOTEXISTS"/>结果代码</returns>
		Result<object> GetProperty(string a_name);
		/// <summary>
		/// 获取指定名称的属性值，字符串形式
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<string> GetPropertyString(string a_name);
		/// <summary>
		/// 获取指定名称的属性值，整数形式
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<int> GetPropertyInt(string a_name);
		/// <summary>
		/// 获取指定名称的属性值，布尔形式
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<bool> GetPropertyBool(string a_name);
		/// <summary>
		/// 获取指定名称的属性值，数值形式
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<decimal> GetPropertyDecimal(string a_name);
		/// <summary>
		/// 获取指定名称的属性值，日期时间形式
		/// </summary>
		/// <param name="a_name">属性名称</param>
		/// <returns>结果</returns>
		Result<DateTime> GetPropertyDateTime(string a_name);
	}
}
